<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>
        <!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="dynsections.js"></script>
        <link rel="stylesheet" type="text/css" href="search/search.css" />
        <link rel="stylesheet" type="text/css" href="searchOverrides.css" />
        <script type="text/javascript" src="search/searchdata.js"></script>
        <script type="text/javascript" src="search/search.js"></script>
        <script type="text/javascript">
        /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
          $(document).ready(function() { init_search(); });
        /* @license-end */
        </script>
    </head>
    <body>
        <div id="banner-container">
            <div id="banner">
                <span id="sfml">SFML 2.6.1</span>
            </div>
        </div>
        <div id="content">
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">SFML Documentation </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="welcome"></a>
Welcome</h1>
<p>Welcome to the official SFML documentation. Here you will find a detailed view of all the SFML classes and functions. <br  />
 If you are looking for tutorials, you can visit the official website at <a href="https://www.sfml-dev.org/">www.sfml-dev.org</a>.</p>
<h1><a class="anchor" id="example"></a>
Short example</h1>
<p>Here is a short example, to show you how simple it is to use SFML:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;SFML/Audio.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;SFML/Graphics.hpp&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main()</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// Create the main window</span></div>
<div class="line">    <a class="code hl_class" href="classsf_1_1RenderWindow.html">sf::RenderWindow</a> window(<a class="code hl_class" href="classsf_1_1VideoMode.html">sf::VideoMode</a>(800, 600), <span class="stringliteral">&quot;SFML window&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Load a sprite to display</span></div>
<div class="line">    <a class="code hl_class" href="classsf_1_1Texture.html">sf::Texture</a> texture;</div>
<div class="line">    <span class="keywordflow">if</span> (!texture.<a class="code hl_function" href="classsf_1_1Texture.html#a8e1b56eabfe33e2e0e1cb03712c7fcc7">loadFromFile</a>(<span class="stringliteral">&quot;cute_image.jpg&quot;</span>))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line">    <a class="code hl_class" href="classsf_1_1Sprite.html">sf::Sprite</a> sprite(texture);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Create a graphical text to display</span></div>
<div class="line">    <a class="code hl_class" href="classsf_1_1Font.html">sf::Font</a> font;</div>
<div class="line">    <span class="keywordflow">if</span> (!font.<a class="code hl_function" href="classsf_1_1Font.html#ab020052ef4e01f6c749a85571c0f3fd1">loadFromFile</a>(<span class="stringliteral">&quot;arial.ttf&quot;</span>))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line">    <a class="code hl_class" href="classsf_1_1Text.html">sf::Text</a> text(<span class="stringliteral">&quot;Hello SFML&quot;</span>, font, 50);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Load a music to play</span></div>
<div class="line">    <a class="code hl_class" href="classsf_1_1Music.html">sf::Music</a> music;</div>
<div class="line">    <span class="keywordflow">if</span> (!music.<a class="code hl_function" href="classsf_1_1Music.html#a3edc66e5f5b3f11e84b90eaec9c7d7c0">openFromFile</a>(<span class="stringliteral">&quot;nice_music.ogg&quot;</span>))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Play the music</span></div>
<div class="line">    music.<a class="code hl_function" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144">play</a>();</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Start the game loop</span></div>
<div class="line">    <span class="keywordflow">while</span> (window.isOpen())</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Process events</span></div>
<div class="line">        <a class="code hl_class" href="classsf_1_1Event.html">sf::Event</a> event;</div>
<div class="line">        <span class="keywordflow">while</span> (window.pollEvent(event))</div>
<div class="line">        {</div>
<div class="line">            <span class="comment">// Close window: exit</span></div>
<div class="line">            <span class="keywordflow">if</span> (event.<a class="code hl_variable" href="classsf_1_1Event.html#adf2f8044f713fd9d6019077b0d1ffe0a">type</a> == <a class="code hl_enumvalue" href="classsf_1_1Event.html#af41fa9ed45c02449030699f671331d4aa316e4212e083f1dce79efd8d9e9c0a95">sf::Event::Closed</a>)</div>
<div class="line">                window.close();</div>
<div class="line">        }</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Clear screen</span></div>
<div class="line">        window.clear();</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Draw the sprite</span></div>
<div class="line">        window.draw(sprite);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Draw the string</span></div>
<div class="line">        window.draw(text);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Update the window</span></div>
<div class="line">        window.display();</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
<div class="ttc" id="aclasssf_1_1Event_html"><div class="ttname"><a href="classsf_1_1Event.html">sf::Event</a></div><div class="ttdoc">Defines a system event and its parameters.</div><div class="ttdef"><b>Definition</b> <a href="Event_8hpp_source.html#l00044">Event.hpp:45</a></div></div>
<div class="ttc" id="aclasssf_1_1Event_html_adf2f8044f713fd9d6019077b0d1ffe0a"><div class="ttname"><a href="classsf_1_1Event.html#adf2f8044f713fd9d6019077b0d1ffe0a">sf::Event::type</a></div><div class="ttdeci">EventType type</div><div class="ttdoc">Type of the event.</div><div class="ttdef"><b>Definition</b> <a href="Event_8hpp_source.html#l00220">Event.hpp:220</a></div></div>
<div class="ttc" id="aclasssf_1_1Event_html_af41fa9ed45c02449030699f671331d4aa316e4212e083f1dce79efd8d9e9c0a95"><div class="ttname"><a href="classsf_1_1Event.html#af41fa9ed45c02449030699f671331d4aa316e4212e083f1dce79efd8d9e9c0a95">sf::Event::Closed</a></div><div class="ttdeci">@ Closed</div><div class="ttdoc">The window requested to be closed (no data)</div><div class="ttdef"><b>Definition</b> <a href="Event_8hpp_source.html#l00190">Event.hpp:190</a></div></div>
<div class="ttc" id="aclasssf_1_1Font_html"><div class="ttname"><a href="classsf_1_1Font.html">sf::Font</a></div><div class="ttdoc">Class for loading and manipulating character fonts.</div><div class="ttdef"><b>Definition</b> <a href="Font_8hpp_source.html#l00048">Font.hpp:49</a></div></div>
<div class="ttc" id="aclasssf_1_1Font_html_ab020052ef4e01f6c749a85571c0f3fd1"><div class="ttname"><a href="classsf_1_1Font.html#ab020052ef4e01f6c749a85571c0f3fd1">sf::Font::loadFromFile</a></div><div class="ttdeci">bool loadFromFile(const std::string &amp;filename)</div><div class="ttdoc">Load the font from a file.</div></div>
<div class="ttc" id="aclasssf_1_1Music_html"><div class="ttname"><a href="classsf_1_1Music.html">sf::Music</a></div><div class="ttdoc">Streamed music played from an audio file.</div><div class="ttdef"><b>Definition</b> <a href="Music_8hpp_source.html#l00048">Music.hpp:49</a></div></div>
<div class="ttc" id="aclasssf_1_1Music_html_a3edc66e5f5b3f11e84b90eaec9c7d7c0"><div class="ttname"><a href="classsf_1_1Music.html#a3edc66e5f5b3f11e84b90eaec9c7d7c0">sf::Music::openFromFile</a></div><div class="ttdeci">bool openFromFile(const std::string &amp;filename)</div><div class="ttdoc">Open a music from an audio file.</div></div>
<div class="ttc" id="aclasssf_1_1RenderWindow_html"><div class="ttname"><a href="classsf_1_1RenderWindow.html">sf::RenderWindow</a></div><div class="ttdoc">Window that can serve as a target for 2D drawing.</div><div class="ttdef"><b>Definition</b> <a href="RenderWindow_8hpp_source.html#l00044">RenderWindow.hpp:45</a></div></div>
<div class="ttc" id="aclasssf_1_1SoundStream_html_afdc08b69cab5f243d9324940a85a1144"><div class="ttname"><a href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144">sf::SoundStream::play</a></div><div class="ttdeci">void play()</div><div class="ttdoc">Start or resume playing the audio stream.</div></div>
<div class="ttc" id="aclasssf_1_1Sprite_html"><div class="ttname"><a href="classsf_1_1Sprite.html">sf::Sprite</a></div><div class="ttdoc">Drawable representation of a texture, with its own transformations, color, etc.</div><div class="ttdef"><b>Definition</b> <a href="Sprite_8hpp_source.html#l00047">Sprite.hpp:48</a></div></div>
<div class="ttc" id="aclasssf_1_1Text_html"><div class="ttname"><a href="classsf_1_1Text.html">sf::Text</a></div><div class="ttdoc">Graphical text that can be drawn to a render target.</div><div class="ttdef"><b>Definition</b> <a href="Text_8hpp_source.html#l00048">Text.hpp:49</a></div></div>
<div class="ttc" id="aclasssf_1_1Texture_html"><div class="ttname"><a href="classsf_1_1Texture.html">sf::Texture</a></div><div class="ttdoc">Image living on the graphics card that can be used for drawing.</div><div class="ttdef"><b>Definition</b> <a href="Texture_8hpp_source.html#l00048">Texture.hpp:49</a></div></div>
<div class="ttc" id="aclasssf_1_1Texture_html_a8e1b56eabfe33e2e0e1cb03712c7fcc7"><div class="ttname"><a href="classsf_1_1Texture.html#a8e1b56eabfe33e2e0e1cb03712c7fcc7">sf::Texture::loadFromFile</a></div><div class="ttdeci">bool loadFromFile(const std::string &amp;filename, const IntRect &amp;area=IntRect())</div><div class="ttdoc">Load the texture from a file on disk.</div></div>
<div class="ttc" id="aclasssf_1_1VideoMode_html"><div class="ttname"><a href="classsf_1_1VideoMode.html">sf::VideoMode</a></div><div class="ttdoc">VideoMode defines a video mode (width, height, bpp)</div><div class="ttdef"><b>Definition</b> <a href="VideoMode_8hpp_source.html#l00041">VideoMode.hpp:42</a></div></div>
</div><!-- fragment --> </div></div><!-- PageDoc -->
</div><!-- contents -->
        </div>
        <div id="footer-container">
            <div id="footer">
                SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
                Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
                Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
            </div>
        </div>
    </body>
</html>
